<?php 
namespace Admin\Model;

/**
 * 首页服务类
 */
class IndexModel extends BaseModel {
	protected $tableName = 'sys_configs'; 
	/**
	 * 商城配置信息
	 */
	public function loadConfigsForParent() {
		$m = M('sys_configs');
		$sql = "select * from __PREFIX__sys_configs where fieldType!='hidden' order by parentId asc,fieldSort asc";
		$rs = $this->query($sql);
		$configs = array();
		if(count($rs)>0){
			foreach ($rs as $key=>$v){
				if($v['fieldtype']=='radio' || $v['fieldtype']=='select'){
					$v['txt'] = explode('||',$v['valuerangetxt']);
					$v['val'] = explode(',',$v['valuerange']);
				}
				$configs[$v['parentid']][] = $v;
			}
		}
		// dump($configs);
		return $configs;

	}
	


}
 ?>